<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<f:view>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
            <title>Global Image - Nova folha de pagamento</title>
            <link rel="stylesheet" type="text/css" href="/globalimage2/faces/jsfcrud.css" /><%@ include file="/WEB-INF/jspf/AjaxScripts.jspf" %><script type="text/javascript" src="/globalimage2/faces/jsfcrud.js"></script>
        </head>
        <body>
            <%@include file="../../WEB-INF/jspf/header/head.jspf"%>
            <div style="float:left">
                <%@include file="../../WEB-INF/jspf/header/menuDinamico.jspf"%>
            </div>
            <div id="div_content">
                <div class="bgContentTable">
                    <div class="titleTable"><h3>Nova folha de pagamento</h3></div><br />
                    <h:form>

                        &nbsp;&nbsp;&nbsp;<h:commandLink action="#{folhaPagamento.create}" value="Salvar"/>
                        &nbsp;|&nbsp;
                        <h:commandLink action="#{folhaPagamento.listSetup}" value="Exibir todos" immediate="true"/>

                        <h:panelGroup id="messagePanel" layout="block">
                            <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
                        </h:panelGroup>
                        <br/>

                        <h:inputHidden id="validateCreateField" validator="#{folhaPagamento.validateCreate}" value="value"/>
                        <h:panelGrid columns="2" style="margin-left:10px;">
                            <h:outputText value="Funcionário:"/>
                            <h:selectOneMenu id="funcionarioId" value="#{folhaPagamento.folhaPagamento.funcionarioId}" title="FuncionarioId" required="true" requiredMessage="The funcionarioId field is required." >
                                <f:selectItems value="#{funcionario.funcionarioItemsAvailableSelectOne}"/>
                            </h:selectOneMenu>

                            <h:outputText value="Data do pagamento:"/>
                            <h:panelGrid columns="3">
                                <h:selectOneMenu value="#{folhaPagamento.datePagamento.dia}">
                                    <f:selectItems value="#{utilController.arrayDias}"/>
                                </h:selectOneMenu>
                                <h:selectOneMenu value="#{folhaPagamento.datePagamento.mes}">
                                    <f:selectItems value="#{utilController.arrayMeses}"/>
                                </h:selectOneMenu>
                                <h:selectOneMenu value="#{folhaPagamento.datePagamento.ano}">
                                    <f:selectItems value="#{utilController.arrayAnosMaisDez}"/>
                                </h:selectOneMenu>
                            </h:panelGrid>
                            <h:outputText value="Salário:"/>
                            <h:inputText id="salario" value="#{folhaPagamento.folhaPagamento.salario}" title="Salario" required="true" requiredMessage="The salario field is required.">
                                <f:convertNumber type="currency"/>
                            </h:inputText>
                            <h:outputText value="Adiantamento:"/>
                            <h:inputText id="adiantamento" value="#{folhaPagamento.folhaPagamento.adiantamento}" title="Adiantamento" required="true" requiredMessage="The adiantamento field is required.">
                                <f:convertNumber type="currency"/>
                            </h:inputText>
                            <h:outputText value="Extra:"/>
                            <h:inputText id="extra" value="#{folhaPagamento.folhaPagamento.extra}" title="Extra" required="true" requiredMessage="The extra field is required.">
                                <f:convertNumber type="currency"/>
                            </h:inputText>
                        </h:panelGrid>
                    </h:form>
                </div>
            </div>
        </body>
    </html>
</f:view>
